package com.songcha.library_common.util


import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity


class JumpUtil {
    companion object{
        @JvmStatic
        fun toActivity(context: Context,cls:Class<*>){
            val intent=Intent(context, cls)
            context.startActivity(intent)
        }

        @JvmStatic
        fun toActivityAndClearAll(context: Context,cls:Class<*>,isExitApp:Boolean=false){
            val intent=Intent(context,cls)
            intent.flags=(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_TASK_ON_HOME)
            intent.putExtra("is_exit",isExitApp)
            context.startActivity(intent)
        }




    }
}